home *** CD-ROM | disk | FTP | other *** search
- /********************************/
- /* File: DrawCommands.h */
- /* */
- /* ---------------------------- */
- /* © 1989 Donald Koscheka */
- /* All Rights Reserved */
- /********************************/
-
- #include <MacTypes.h>
- #include <OSUtil.h>
- #include <MemoryMgr.h>
- #include <FileMgr.h>
- #include <ResourceMgr.h>
- #include <pascal.h>
- #include <string.h>
- #include <stdio.h>
- #include <hfs.h>
- #include <sane.h>
- #include <SANEUtils.h>
-
- #define WINDOW_HDR 10
-
- /***** TOKEN RESOURCE IDS *****/
- #define DRAW_COMMANDS 12561
- #define WINDOW_TYPES 8499 /* id of the window type resource */
-
- #define STRING_TYPE 'STR#'
- #define FALSE 0
- #define TRUE 1
-
-
- #define CR 0x0D
- #define NEWLINE 0x0D
- #define LF 0x0A
- #define TAB 0x09
-
- #define TEXT_SIZE 9 /* size of default fonts */
-
-
- /* List of drawing commands */
-
- #define DATA_SET_HEADER \
- Handle next; \
- Handle last; \
- short token;
-
-
- /*** these are the data declarations for the ***/
- /*** type of data that we plot. ***/
-
- /*** !!! IN THE FUTURE, USE EXTENDED TO AVOID ***/
- /*** UNNECESARY CONVERSIONS ***/
- typedef extended plot_data;
- typedef plot_data *plot_ptr;
- typedef plot_ptr *plot_hand;
-
-
-
- typedef struct dataSet{
- DATA_SET_HEADER
- }dataSet, *dataPtr, **dataHand;
-
-
- typedef struct titleObj{
- DATA_SET_HEADER
- Rect theRect;
- short font;
- short size;
- short style;
- short just;
- short color;
- Handle text; /* Handle to the text itself */
- }titleObj, *titlPtr, **titlHand;
-
-
-
- /********************************/
- /* We maintain a private window */
- /* list in the system heap in */
- /* the following structure. */
- /* */
- /* I call these window things */
- /* "posts" in honor of the */
- /* post-it note which is an */
- /* interesting communications */
- /* medium in its own right */
- /********************************/
-
- typedef struct post{
- struct post **next; /*** handle to next window ***/
- struct post **last; /*** handle to previous window ***/
- WindowPtr wind; /*** pointer to our window ***/
- WindowRecord wStore; /*** toolbox window record ***/
- ListHandle list; /*** window's drawing objects ***/
- char name[32]; /*** the name of this window ***/
- short is_color; /*** True if color window ***/
- short id; /*** id of window (reserved) ***/
- }post, *postPtr, **postHand;
-
-
-
- /********************************/
- /* Internal globals are */
- /* stored in the system heap */
- /* in the following structure */
- /* */
- /********************************/
-
- typedef struct{
- postHand list; /*** list of post-it notes ***/
- Handle evtProc; /*** Points to our event handler ***/
- ProcPtr oldTrap; /*** previous address of event trap ***/
- Handle userData; /*** for use by the application ***/
- } wdGlobals, *wdGlobalsPtr, **wdGlobalsHand;
-
-
- void *GetWindowHeader( short theTrap );
- void SetWindowHeader( short theTrap, void *theHeader );
- postHand find_post( wdGlobalsPtr windP, WindowPtr which );
- void remove_post( wdGlobalsPtr wdPtr, postHand postIt );
- void add_post( wdGlobalsPtr wdPtr, postHand postIt );
- postHand Find_Window_By_Name( postHand postList, char *name );
-